 
%include
:- lib(ic).

coffeemachine1Coffeemachine1(OState , Arg , Res , NState):-

% contraints
OState = [MPre], 
NState = [M], 
Arg = [],
Res = [],
 
% domain
[M]:: -32768 .. 32767,
indomain(M),

% body
M #= 0.

coffeemachine1Insert(OState , Arg , Res , NState):-

% contraints
OState = [MPre], 
NState = [M], 
Arg = [],
Res = [],
 
% domain
[M]:: -32768 .. 32767,
indomain(M),

% body
M #= MPre + 1.

coffeemachine1Coffee(OState , Arg , Res , NState):-

% contraints
OState = [MPre], 
NState = [M], 
Arg = [],
Res = [],
 
% domain
[M]:: -32768 .. 32767,
indomain(M),

% body
M #= MPre - 1.

coffeemachine1Draw(OState , Arg , Res , NState):-

% contraints
OState = [MPre], 
NState = [M], 
Arg = [],
Res = [],
 
% domain
[M]:: -32768 .. 32767,
indomain(M),

% body
M #= 0.


coffeemachine1CoffeeGuard1(OState , Arg , Res , NState):-
% contraints
OState = [MPre], 
NState = [M], 
Arg = [],
Res = [],
 
% domain
[M]:: -32768 .. 32767,
indomain(M),
 
% body
MPre#>1,
M #= MPre.

coffeemachine1CoffeeGuard2(OState , Arg , Res , NState):-
% contraints
OState = [MPre], 
NState = [M], 
Arg = [],
Res = [],
 
% domain
[M]:: -32768 .. 32767,
indomain(M),
 
% body
MPre#=1,
M #= MPre.
 
%path 
testpath(1, Arg , Res , NState):-
 
coffeemachine1Coffeemachine1( _ , Arg0 , Res0 , S1),
NState = [S1|NState1],
Arg = [Arg0|A0],
Res = [Res0|R0],
 
coffeemachine1Insert(S1 , Arg1 , Res1 , S2),
NState1= [S2|NState2],
A0= [Arg1|A1],
R0= [Res1|R1],
 
coffeemachine1Insert(S2 , Arg2 , Res2 , S3),
NState2= [S3|NState3],
A1= [Arg2|A2],
R1= [Res2|R2],
 
coffeemachine1Insert(S3 , Arg3 , Res3 , S4),
NState3= [S4|NState4],
A2= [Arg3|A3],
R2= [Res3|R3],
 
coffeemachine1CoffeeGuard2(S4 , Arg4 , Res4 , S5),
NState4= [S5|NState5],
A3= [Arg4|A4],
R3= [Res4|R4],
 
coffeemachine1Coffee(S5 , Arg5 , Res5 , S6),
NState5= [S6],
A4= [Arg5],
R4= [Res5].
